package com.yjy.shmily;

import android.Manifest;
import android.os.Handler;

import androidx.core.app.ActivityCompat;
import androidx.core.content.PermissionChecker;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.yjy.mybase.activity.BaseActivity;
import com.yjy.mybase.utils.ARouterUri;

/**
 * author : YangJinyang
 * create : 2019-10-28 16:56
 * description :
 */


@Route(path = ARouterUri.ACTIVITY_SPLASH)
public class SplashActivity extends BaseActivity {

    private Handler handler;

    @Override
    public int layout() {
        return R.layout.activity_splash;
    }

    @Override
    public void initView() {
        handler = new Handler();

    }

    @Override
    public void initData() {
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                ARouter.getInstance().build(ARouterUri.ACTIVITY_MAIN).navigation();
                finish();

            }
        }, 1500);
//        if (PermissionChecker.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)==PermissionChecker.PERMISSION_GRANTED) {
//
//        } else {
//            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0x11);
//        }


    }
}
